package com.neusoft.eenie.signdemo.adapter;

import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;

import com.neusoft.eenie.signdemo.R;
import com.neusoft.eenie.signdemo.bean.SignInfo;

/**
 * Created by Eenie on 2016/3/25.
 *
 */
public class CheckNameHolder {
    View view;
    CheckBox boxName;
    CheckNameHolder(View v) {
        this.view = v;
        this.boxName = (CheckBox) v.findViewById(R.id.checkName);

    }


    public void bindData(final SignInfo info) {
        boxName.setText(info.getName());
        boxName.setChecked(info.isCheck());
        boxName.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                info.setCheck(isChecked);
            }
        });
    }

}
